<script type="text/javascript">

$(document).ready(function(){

$("#id_jabatan").change(function(){
$("#jabatan").val($("#id_jabatan option:selected").text());
});

});

</script>
<div class="form">
<?php /** @var BootActiveForm $form */
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id'=>'horizontalForm',
    'type'=>'horizontal',
	'htmlOptions'=>array('enctype' => 'multipart/form-data'),
)); ?>

     	<fieldset>
		<legend>
			<span class="required">*</span> Wajib Diisi.
		</legend>

	<?php echo $form->errorSummary($model,'Opps!!!', null,array('class'=>'alert alert-error span12')); ?>
        		
   <div class="control-group">		
			<div class="span4">

	
	<?php echo $form->textFieldRow($model,'nama',array('class'=>'span5','maxlength'=>100)); ?>

	<?php echo $form->dropDownListRow($model, 'id_jabatan', array(
	1 => 'Kepala Kejaksaan Tinggi DKI', 
	2 => 'Wakil Kepala Kejaksaan Tinggi DKI',
	3 => 'Asisten Pembinaan',
	4 => 'Asisten Intelijen',
	5 => 'Asisten T.P. Umum',
	6 => 'Asisten T.P Khusus',
	7 => 'Asisten Perdata dan TUN',
	8 => 'Asisten Pengawasan',
	9 => 'Kepala Bagian Tata Usaha',
	), array('prompt'=>'Jabatan','id'=>'id_jabatan')); ?>

	<?php echo $form->hiddenField($model,'jabatan',array('class'=>'span5','maxlength'=>100, 'id'=>'jabatan')); ?>


	<?php echo $form->textAreaRow($model,'profil',array('rows'=>2, 'cols'=>40, 'class'=>'span5')); ?>

	<?php
	if($model->isNewRecord){
	?>
	<div class="row">
		<?php echo $form->fileFieldRow($model, 'photo'); ?>
		<?php echo $form->error($model,'photo'); ?>
	</div>
	<?php
	}else{
	?>
	<div class="row">
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo Yii::app()->request->baseUrl; ?>/images/pejabat/<?php echo $model->photo; ?>" height="200" width="200" />
		<?php echo $form->fileFieldRow($model, 'photo'); ?>
		<?php echo $form->error($model,'photo'); ?>
	</div>
	<?php
	}
	?>

                        </div>   
  </div>

	<div class="form-actions" style="text-align:center">
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'submit',
			'type'=>'primary',
                        'icon'=>'ok white',  
			'label'=>$model->isNewRecord ? 'Tambah' : 'Simpan',
		)); ?>
              <?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'reset',
                        'icon'=>'remove',  
			'label'=>'Reset',
		)); ?>
	</div>
</fieldset>

<?php $this->endWidget(); ?>

</div>
